
package com.borqs.music.tasks;

import static com.borqs.music.util.MusicConf.ReqParam.ISFULL;
import static com.borqs.music.util.MusicConf.ReqType.MUSIC_INFO;

import java.util.HashMap;
import java.util.Map;

import com.borqs.music.executor.TaskListener;
import com.borqs.music.http.HttpRequest;
import com.borqs.music.http.RequestMethod;
import com.borqs.music.util.MusicConf;

public class GetSingleSongTask extends SongTask {
    private long mId;

    public GetSingleSongTask(TaskListener listener, long id) {
        super(listener, false);
        mId = id;
    }

    public GetSingleSongTask(TaskListener listener, long id, boolean isFullInfo) {
        super(listener, isFullInfo);
        mId = id;
    }

    @Override
    public HttpRequest prepareRequest() {
        Map<String, String> params = new HashMap<String, String>(5);
        params.put("songid", String.valueOf(mId));
        params.put(ISFULL, String.valueOf(isFull()));
        
        final String url = MusicConf.getUrl(MUSIC_INFO);
        HttpRequest req = new HttpRequest(RequestMethod.GET, url, null, params);

        return req;
    }
}
